package com.ptadmin.report.converter;

public abstract class ReportConverterBase {
//	protected List<Object> items = new ArrayList<Object>();
	protected boolean isRead = false;
	
//	protected abstract Object buildItem(String[] row);
	
	protected abstract void doReadFrom(String path);
	
	protected abstract String doToJson();
	
	public final void readFrom(String path) {
		doReadFrom(path);
		isRead = true;
	}
	
	public final String toJson() {
		if (!isRead) {
			throw new RuntimeException("readFrom is not called...");
		}
		return doToJson();
	}
}
